package com.homework.test2;

import java.util.Scanner;

public class Demo2 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("从键盘输入整数，输入0结束");
        int count1=0;
        int count2=0;
        while (true){
            int i = input.nextInt();
            if (i==0){
                break;
            }
            if (i<0){
                count1++;
            }
            if (i>0){
                count2++;
            }
        }
        System.out.println("正数有"+count1+"个");
        System.out.println("负数有"+count2+"个");
    }
}
